{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "53755135",
   "metadata": {},
   "outputs": [],
   "source": [
    "### 1.随机数生成六个班的考试成绩，3门考试：Python、数学、语文。每个班50人\n",
    "### 2.将六个班的考试成绩进行合并得到score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "0cb1bdf0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[[ 83,  19,  49],\n",
       "        [ 12,  64,  64],\n",
       "        [  9,  78,  39],\n",
       "        [ 35,   9,  54],\n",
       "        [ 28,  91,  96],\n",
       "        [ 33,  62,   4],\n",
       "        [ 66,  61,   7],\n",
       "        [ 51,  92,  98],\n",
       "        [ 53,  36,  42],\n",
       "        [ 67,  77,  70],\n",
       "        [ 19,  91,  78],\n",
       "        [ 62,  73,  75],\n",
       "        [ 56,  18,  64],\n",
       "        [ 63,  44,  47],\n",
       "        [100,  22,  22],\n",
       "        [ 29,  75,  35],\n",
       "        [ 90,  52,  13],\n",
       "        [ 56,  35,  87],\n",
       "        [ 89,  38,  21],\n",
       "        [ 28,  64,  70],\n",
       "        [ 26,  59,  77],\n",
       "        [ 28,  94,  82],\n",
       "        [ 55,  97,  49],\n",
       "        [ 80,  72,  72],\n",
       "        [ 71,  33,  75],\n",
       "        [ 63,   4,  78],\n",
       "        [ 44,  67,  23],\n",
       "        [ 32,  57,  49],\n",
       "        [ 56,  87,  57],\n",
       "        [ 40,  78,  44],\n",
       "        [ 29,  14,  76],\n",
       "        [ 21,  77,  23],\n",
       "        [ 10,   0,   6],\n",
       "        [ 33,  32,   6],\n",
       "        [ 93,  90,  29],\n",
       "        [ 23,  87,  45],\n",
       "        [ 90,  26,  80],\n",
       "        [ 33,  92,  95],\n",
       "        [ 34,  22,  74],\n",
       "        [  3,  13,  73],\n",
       "        [ 73,   1,  49],\n",
       "        [ 46,  98,  34],\n",
       "        [ 63,  73,  97],\n",
       "        [ 82,  16,  67],\n",
       "        [ 23,  41,  28],\n",
       "        [ 82,  40,  50],\n",
       "        [ 70,  87,  19],\n",
       "        [ 67,  19,  65],\n",
       "        [ 41,  10,  34],\n",
       "        [ 78, 100,  29]],\n",
       "\n",
       "       [[ 16,  20,  93],\n",
       "        [ 61,  36,  65],\n",
       "        [ 35,  63,  22],\n",
       "        [ 15,  84,  78],\n",
       "        [ 94,  67,  43],\n",
       "        [ 97,  79,  83],\n",
       "        [ 22,  17,   6],\n",
       "        [ 59,   5,  46],\n",
       "        [ 86,  15,  55],\n",
       "        [ 26,  62,  53],\n",
       "        [ 70,  11,  34],\n",
       "        [ 10,  81,  29],\n",
       "        [ 84,  53,  97],\n",
       "        [ 13,  18, 100],\n",
       "        [ 57,  41,   7],\n",
       "        [ 78,  12,   3],\n",
       "        [ 72,  80,   7],\n",
       "        [ 28,  72,  79],\n",
       "        [  2,  93,  20],\n",
       "        [ 54,  38,  97],\n",
       "        [  1,  82,  26],\n",
       "        [ 60,  72,  50],\n",
       "        [  3,  71,  16],\n",
       "        [ 70,  35,  52],\n",
       "        [  6,  39,   1],\n",
       "        [ 39,  37,   8],\n",
       "        [ 32,  88,   7],\n",
       "        [  6,  48,  85],\n",
       "        [ 98,  66,  17],\n",
       "        [ 34,  70,  46],\n",
       "        [ 49,  48,  77],\n",
       "        [ 20,  29,  58],\n",
       "        [ 59,  75,   1],\n",
       "        [ 33,  56,  79],\n",
       "        [  4,   3,   9],\n",
       "        [ 42,  23,  67],\n",
       "        [ 97,  57,  67],\n",
       "        [ 70,  70,  54],\n",
       "        [ 16,  90,  82],\n",
       "        [ 34,   5,  23],\n",
       "        [  7,  93,  45],\n",
       "        [ 48,  98,  44],\n",
       "        [ 18,  37,  56],\n",
       "        [ 49,  35,  65],\n",
       "        [ 39,  93,  86],\n",
       "        [ 98,  87,  47],\n",
       "        [ 32,  93,  70],\n",
       "        [ 64,  65,  23],\n",
       "        [ 43,  23,  94],\n",
       "        [ 80,  81,  57]],\n",
       "\n",
       "       [[ 88,  26,  92],\n",
       "        [ 65,   5,  26],\n",
       "        [ 53,   8,  84],\n",
       "        [ 86,  13,  73],\n",
       "        [ 19,  50,  75],\n",
       "        [ 55,  12,   7],\n",
       "        [  4,  74,  29],\n",
       "        [100,  63,  73],\n",
       "        [ 37,  99,  65],\n",
       "        [ 33, 100,  19],\n",
       "        [ 24,  74,  39],\n",
       "        [ 57,  28,  24],\n",
       "        [ 92,  33,  20],\n",
       "        [100,  35,  83],\n",
       "        [ 43,  75,  24],\n",
       "        [  3,  82,  26],\n",
       "        [ 24,  85,  17],\n",
       "        [ 22,  43,  37],\n",
       "        [  1,  37,  57],\n",
       "        [  0,  56,  11],\n",
       "        [ 90,  28,  55],\n",
       "        [ 84,  63,  20],\n",
       "        [ 63,  27,  28],\n",
       "        [ 80,  59,  77],\n",
       "        [ 30,  95,  69],\n",
       "        [ 10,  66,  51],\n",
       "        [ 94,  89,  79],\n",
       "        [  5,  97,  72],\n",
       "        [ 48,  50,  32],\n",
       "        [ 21,   7,  79],\n",
       "        [  6,  54,  71],\n",
       "        [ 72,  68,  12],\n",
       "        [ 24,  29,  49],\n",
       "        [ 84,  80,  33],\n",
       "        [ 89,  42,  51],\n",
       "        [ 26,  93,   0],\n",
       "        [ 21,  15,  68],\n",
       "        [ 61,   7,  38],\n",
       "        [ 22,   5,  70],\n",
       "        [ 86,  30,  88],\n",
       "        [ 15,  87,  54],\n",
       "        [ 20,  98,   8],\n",
       "        [ 12,  90,  63],\n",
       "        [ 46,   8,  73],\n",
       "        [ 54,  15,  32],\n",
       "        [ 72,  20,  54],\n",
       "        [ 69,  15,  19],\n",
       "        [ 34,  36,  73],\n",
       "        [ 17,  54,  96],\n",
       "        [ 28,  96,  76]],\n",
       "\n",
       "       [[ 96,  68,  48],\n",
       "        [ 47,   2,  79],\n",
       "        [ 26,  15,  21],\n",
       "        [ 68,  72,  55],\n",
       "        [ 74,  53,   6],\n",
       "        [ 44,  21,  10],\n",
       "        [  0, 100,  59],\n",
       "        [ 70,  62,  35],\n",
       "        [ 41,  93,  94],\n",
       "        [ 10,  55,   7],\n",
       "        [ 29,   2,  52],\n",
       "        [ 25,  85,   2],\n",
       "        [ 95,  78,  14],\n",
       "        [  3,  61,  34],\n",
       "        [  9,  79,  17],\n",
       "        [ 81,  42,  58],\n",
       "        [ 21,  61,  12],\n",
       "        [ 44,  93,  65],\n",
       "        [ 92,  86,  84],\n",
       "        [ 45,  55,  50],\n",
       "        [ 87,  31,  18],\n",
       "        [ 75,  12,  52],\n",
       "        [ 29,   9,  24],\n",
       "        [ 83,  28,  58],\n",
       "        [ 87,  77,  96],\n",
       "        [ 94,  24,   6],\n",
       "        [  6,  53,  95],\n",
       "        [ 56,  31,   6],\n",
       "        [ 13,  16,   1],\n",
       "        [ 90,  35,  41],\n",
       "        [ 23,  89, 100],\n",
       "        [  2,  13,  75],\n",
       "        [ 23,  80,  91],\n",
       "        [ 28,  45,  96],\n",
       "        [ 27,  35,  74],\n",
       "        [  4,  30,  79],\n",
       "        [ 57,  79,  51],\n",
       "        [ 10,  84,  24],\n",
       "        [ 11,  15, 100],\n",
       "        [ 92,  49,  20],\n",
       "        [  0,  39,  85],\n",
       "        [  7,  35,  42],\n",
       "        [ 40,  70,  56],\n",
       "        [  3,  83,  64],\n",
       "        [ 88,  40,  72],\n",
       "        [ 58,  63,  24],\n",
       "        [ 55,  94,  60],\n",
       "        [ 86,  27,  42],\n",
       "        [ 13,  17,  31],\n",
       "        [ 94,  21,  87]],\n",
       "\n",
       "       [[ 87,  18,  93],\n",
       "        [ 11,  11,  61],\n",
       "        [ 74,  47,   2],\n",
       "        [ 69,  73,  85],\n",
       "        [ 51,  27,   1],\n",
       "        [ 25,  34,  58],\n",
       "        [ 23,  11,  11],\n",
       "        [  4,   6,   7],\n",
       "        [ 41,  91,  71],\n",
       "        [ 81,  99,  50],\n",
       "        [ 64,  50,  85],\n",
       "        [ 65,  48,  61],\n",
       "        [ 41,  62,  51],\n",
       "        [ 70,  93,   7],\n",
       "        [ 18,   1,  30],\n",
       "        [ 17,  99,  49],\n",
       "        [ 12,  46,  24],\n",
       "        [ 68,  86,  90],\n",
       "        [ 94,  33,  97],\n",
       "        [ 59,  85,  25],\n",
       "        [ 53,  18,  98],\n",
       "        [ 69,  39,  79],\n",
       "        [ 90,  65,  36],\n",
       "        [ 63,  57,   2],\n",
       "        [ 41,  37,  24],\n",
       "        [ 61,  26,  15],\n",
       "        [ 77,  20,  93],\n",
       "        [ 62,  19,  46],\n",
       "        [ 46,  21,  51],\n",
       "        [ 63,  59,  95],\n",
       "        [ 61,  20,   0],\n",
       "        [ 55,  26,  72],\n",
       "        [ 71,  80,  14],\n",
       "        [ 75,  32,  20],\n",
       "        [ 44,  52,  55],\n",
       "        [ 21,  11,   8],\n",
       "        [ 51,  47,  76],\n",
       "        [ 30,  66,  46],\n",
       "        [ 60,  61,  15],\n",
       "        [ 91,  45,  32],\n",
       "        [ 76,  52,  37],\n",
       "        [ 16,  37,  33],\n",
       "        [ 12,  99,  65],\n",
       "        [ 79,  67,  29],\n",
       "        [ 25,  30,  88],\n",
       "        [ 30,  73,  60],\n",
       "        [ 99,  12,  84],\n",
       "        [ 64,  12,  14],\n",
       "        [ 48,  76,  89],\n",
       "        [ 45,  53,   3]],\n",
       "\n",
       "       [[ 81,  55,  14],\n",
       "        [ 27,  53,  85],\n",
       "        [ 94,  61,  61],\n",
       "        [100,   0,  78],\n",
       "        [ 73,  31,  19],\n",
       "        [ 36,  21,  42],\n",
       "        [ 80,  67,  56],\n",
       "        [ 58,  72,  39],\n",
       "        [ 93,  28,  79],\n",
       "        [ 74,  40,  98],\n",
       "        [ 86,  33,  70],\n",
       "        [ 30,  98,  82],\n",
       "        [ 43,  89,  26],\n",
       "        [ 20,  35,  36],\n",
       "        [ 41,   5,  54],\n",
       "        [ 61,  18,  72],\n",
       "        [ 54,   1,  50],\n",
       "        [ 49,  67,  10],\n",
       "        [  2,  71,  20],\n",
       "        [ 52,  24,  60],\n",
       "        [ 60,  95,  13],\n",
       "        [ 28,  31,  47],\n",
       "        [  3,  82,  60],\n",
       "        [ 11,   7,  25],\n",
       "        [ 40,  11,   1],\n",
       "        [ 32,  13,  40],\n",
       "        [ 53,  27,  24],\n",
       "        [ 87,  22,   2],\n",
       "        [ 76,  12,  60],\n",
       "        [ 54,   4,  55],\n",
       "        [ 87,  54,   4],\n",
       "        [ 47,  37,  62],\n",
       "        [ 97,  33,  34],\n",
       "        [ 48,  75,  50],\n",
       "        [ 61,  58,  24],\n",
       "        [ 16,  85,   2],\n",
       "        [ 58,  16,   3],\n",
       "        [ 26,  26,  18],\n",
       "        [ 74,  42,  29],\n",
       "        [ 99,  52,  80],\n",
       "        [  3,  22,   7],\n",
       "        [ 81,  13,  57],\n",
       "        [ 50,  61,  77],\n",
       "        [ 65,  10,  79],\n",
       "        [ 74,  83,  88],\n",
       "        [ 17,  53,  84],\n",
       "        [ 74,  75,  89],\n",
       "        [ 50,  14,  50],\n",
       "        [ 19,  46,  70],\n",
       "        [ 17,  66,  92]]])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "scores = np.random.randint(0,101,size=(6,50,3))\n",
    "scores"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "48168642",
   "metadata": {},
   "outputs": [],
   "source": [
    "### 3.生成性别数组sex，水平叠加数组sex和score得到data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "b2de415c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[[0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1]],\n",
       "\n",
       "       [[0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0]],\n",
       "\n",
       "       [[0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0]],\n",
       "\n",
       "       [[0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1]],\n",
       "\n",
       "       [[1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0]],\n",
       "\n",
       "       [[1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [1],\n",
       "        [1],\n",
       "        [1],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0],\n",
       "        [0]]])"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sex = np.random.randint(0,2,size=(6,50,1))\n",
    "sex"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "8c9fb98f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[[ 83,  19,  49,   0],\n",
       "        [ 12,  64,  64,   0],\n",
       "        [  9,  78,  39,   1],\n",
       "        ...,\n",
       "        [ 67,  19,  65,   0],\n",
       "        [ 41,  10,  34,   1],\n",
       "        [ 78, 100,  29,   1]],\n",
       "\n",
       "       [[ 16,  20,  93,   0],\n",
       "        [ 61,  36,  65,   1],\n",
       "        [ 35,  63,  22,   0],\n",
       "        ...,\n",
       "        [ 64,  65,  23,   1],\n",
       "        [ 43,  23,  94,   1],\n",
       "        [ 80,  81,  57,   0]],\n",
       "\n",
       "       [[ 88,  26,  92,   0],\n",
       "        [ 65,   5,  26,   1],\n",
       "        [ 53,   8,  84,   1],\n",
       "        ...,\n",
       "        [ 34,  36,  73,   0],\n",
       "        [ 17,  54,  96,   0],\n",
       "        [ 28,  96,  76,   0]],\n",
       "\n",
       "       [[ 96,  68,  48,   0],\n",
       "        [ 47,   2,  79,   1],\n",
       "        [ 26,  15,  21,   1],\n",
       "        ...,\n",
       "        [ 86,  27,  42,   1],\n",
       "        [ 13,  17,  31,   0],\n",
       "        [ 94,  21,  87,   1]],\n",
       "\n",
       "       [[ 87,  18,  93,   1],\n",
       "        [ 11,  11,  61,   0],\n",
       "        [ 74,  47,   2,   1],\n",
       "        ...,\n",
       "        [ 64,  12,  14,   0],\n",
       "        [ 48,  76,  89,   0],\n",
       "        [ 45,  53,   3,   0]],\n",
       "\n",
       "       [[ 81,  55,  14,   1],\n",
       "        [ 27,  53,  85,   0],\n",
       "        [ 94,  61,  61,   0],\n",
       "        ...,\n",
       "        [ 50,  14,  50,   0],\n",
       "        [ 19,  46,  70,   0],\n",
       "        [ 17,  66,  92,   0]]])"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = np.dstack((scores,sex))\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2de5c9e8",
   "metadata": {},
   "outputs": [],
   "source": [
    "### 4.分别计算男女生各科成绩统计指标：最小值、最大值、平均分、中位数、标准差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "eed000ea",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(145, 4)"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cond = data == 1\n",
    "cond2 = data == 0\n",
    "male_cond = cond[:,:,3]\n",
    "female_cond = cond2[:,:,3]\n",
    "# 男生成绩\n",
    "male_scores = data[male_cond]\n",
    "# 女生成绩\n",
    "female_scores = data[male_cond]\n",
    "\n",
    "# male_scores.shape\n",
    "# male_cond\n",
    "# female_cond\n",
    "# male_scores\n",
    "# female_scores"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "44c44a98",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([45.51724138, 47.77931034, 46.88965517,  1.        ])"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 男生成绩平均值\n",
    "male_scores.mean(axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "d2e5b516",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([51.68387097, 51.15483871, 51.01290323,  0.        ])"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 男生成绩平均值\n",
    "female_scores.mean(axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "5cb3763f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([100, 100,  98,   1])"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 男生成绩最大值\n",
    "male_scores.max(axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "d5434c1b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([100, 100, 100,   0])"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 女生成绩最大值\n",
    "female_scores.max(axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "365fb264",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 1, 0, 1])"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 男生成绩最小值\n",
    "male_scores.min(axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "4783ab72",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 0, 0])"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 女生成绩最小值\n",
    "female_scores.min(axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "f65ad95e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([44., 43., 49.,  1.])"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 男生成绩中位数\n",
    "np.median(male_scores, axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "cba32520",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([53., 53., 51.,  0.])"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 女生成绩中位数\n",
    "np.median(female_scores, axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "1abe4f75",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([927.16004756, 948.99957194, 805.21541023,   0.        ])"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 男生总成绩标准差\n",
    "np.var(male_scores, axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "id": "8bd2943d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([719.44199792, 757.45989594, 860.16757544,   0.        ])"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 女生总成绩标准差\n",
    "np.var(female_scores, axis = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c2f39815",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
